<?php use_stylesheet('forms.css') //load css ?>
<div id="nav">
        <ul>
            <a href="<?php echo url_for('sales_index_contacts') ?>"><li class="no_sel"><?php echo image_tag('Icons/ic_menu_contacts.png') ?>Contacts</li></a>
            <a href="<?php echo url_for('sales_index_orders') ?>"><li class="no_sel"><?php echo image_tag('Icons/ic_menu_orders.png') ?>Orders</li></a>
            <a href="<?php echo url_for('sales_index_pnp') ?>"><li class="no_sel"><span style="float: left;"><?php echo image_tag('Icons/ic_menu_products_parts.png') ?></span><span style="float: left; margin: -2px 0 0 0;">Materials</span><span style=" float: left; margin-top: -5px;">&amp; Products</span></li></a>
            <a href="<?php echo url_for('purchase_index') ?>"><li class="no_sel"><?php echo image_tag('Icons/ic_menu_purchase.png') ?>Purchase</li></a>
            <a href="<?php echo url_for('stock_index') ?>"><li class="no_sel"><?php echo image_tag('Icons/ic_menu_stock.png') ?>Stock</li></a>
            <?php if($sf_user->isSuperAdmin()){ ?>
            <a href="<?php echo url_for('admin_index') ?>"><li class="no_sel"><?php echo image_tag('Icons/ic_menu_stock.png') ?>Admin</li></a>
            <?php } ?>
        </ul>
</div>
<div id="page">
    <?php
    if($tab == 'contacts'){
    echo '<h1>Edit Contact</h1>';
    include_partial('formContact', array('form' => $form));
    }
    else if($tab == 'orders'){
    echo '<h1>Edit Order</h1>'; ?>
    <?php include_partial('formOrder', array(
        'form' => $form,  
        'products' => $products, 
        'parts' => $parts, 
        'version' => 'order', 
        'status' => $status, 
        'category' => 'customer order',
        ));
    }
    else if($tab == 'stock'){
    echo '<h1>Edit Stock Order</h1>'; ?>
    <?php include_partial('formOrder', array(
        'form' => $form,  
        'products' => $products,  
        'version' => 'stock', 
        'status' => $status, 
        'category' => 'stock order',
        ));
    }
    else if($tab == 'return'){
    echo '<h1>Edit Return Order</h1>'; ?>
    <?php include_partial('formOrder', array('form' => $form, 'version' => 'return'));
    }
    else if($tab == 'products'){
    echo '<h1>Edit Product</h1>';
    include_partial('formProduct', array('form' => $form, 'parts' => $parts));
    }
    else if($tab == 'parts'){
    echo '<h1>Edit Material</h1>';
    include_partial('formPart', array('form' => $form));
    }
    ?>
</div>